@echo off
chcp 65001 > nul
setlocal enabledelayedexpansion

set logFile=创建日志_%date:~0,4%%date:~5,2%%date:~8,2%.txt
echo [%time%] 开始创建目录 > "%logFile%"

set /a success=0, exist=0, fail=0
for /f "tokens=*" %%i in (文件夹清单.txt) do (
    if not "%%i"=="" (
        if not exist "%%i" (
            mkdir "%%i" 2>nul
            if exist "%%i" (
                echo ✓ 成功创建: %%i
                echo SUCCESS: %%i >> "%logFile%"
                set /a success+=1
            ) else (
                echo ❌ 创建失败: %%i
                echo ERROR: %%i >> "%logFile%"
                set /a fail+=1
            )
        ) else (
            echo ⚠️ 目录已存在: %%i
            echo EXIST: %%i >> "%logFile%"
            set /a exist+=1
        )
    )
)
echo ----------------------------------
echo 统计：成功 %success% 个 | 已存在 %exist% 个 | 失败 %fail% 个
echo 详见日志: %logFile%
pause